package com.jar.exercise.java8新特性.方法的引用;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @author ZhangShengHao
 * @className Employee
 * @description TODO
 * @date 2020/1/27 21:09
 */
public class Employee {
	@Override
	public String toString() {
		return "Employee{" +
			"name='" + name + '\'' +
			", age=" + age +
			", sex='" + sex + '\'' +
			'}';
	}

	private String name;
	private Integer age;
	private String sex;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public Employee(String name, String sex, Integer age) {
		this.name = name;
		this.age = age;
		this.sex = sex;
	}

	public Employee() {
	}

	public static List<Employee> getStudent() {
		List<Employee> list = new ArrayList<Employee>();
		list.add(new Employee("张胜豪", "男", 11));
		list.add(new Employee("张子瑜", "女", 12));
		list.add(new Employee("郭非凡", "男", 12));
		list.add(new Employee("李家美", "女", 33));
		list.add(new Employee("王刚", "男", 39));
		list.add(new Employee("张胜豪", "男", 39));
		return list;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		Employee employee = (Employee) o;
		return Objects.equals(name, employee.name) &&
			Objects.equals(age, employee.age);
	}

	@Override
	public int hashCode() {
		return Objects.hash(name, age);
	}
}
